import io from "socket.io-client";
import { eventBus, eventTypes } from "@/utils/event-bus";

const socket = io('http://localhost:4000', { 
    transports: ['websocket'],
    withCredentials: true,
 });

socket.on('cookie_verify_success', (data, callback) => eventBus.emit(eventTypes.INITAPP, data));
socket.on('connect', () => console.log('已连接服务器 socket.id', socket.id));

export default socket;